<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" href="#" type="image/png">
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">


    <title>Dynamic Table</title>

  <!--dynamic table-->
  <link href="js/advanced-datatable/css/demo_page.css"  th:href="@{/js/advanced-datatable/css/demo_page.css}" rel="stylesheet" />
  <link href="js/advanced-datatable/css/demo_table.css" th:href="@{/js/advanced-datatable/css/demo_table.css}" rel="stylesheet" />
  <link rel="stylesheet" href="js/data-tables/DT_bootstrap.css" th:href="@{/js/data-tables/DT_bootstrap.css}" />

    <div th:include="table/common :: commonheader"></div>

</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <div th:replace="table/common::#leftside"> </div>
    <!-- left side end-->

    <!-- main content start-->
    <div class="main-content" >

        <!-- header section start-->
        <div th:replace="table/common:: #headside"></div>
        <!-- header section end-->

        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                Dynamic Table
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">Dashboard</a>
                </li>
                <li>
                    <a href="#">Data Tables</a>
                </li>
                <li class="active"> Dynamic Table </li>
            </ul>
        </div>
        <!-- page heading end-->

        <!--body wrapper start-->
        <div class="wrapper">
        <div class="row">
        <div class="col-sm-12">
        <section class="panel">
        <header class="panel-heading">
            Dynamic Table
            <span class="tools pull-right">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
                <a href="javascript:;" class="fa fa-times"></a>
             </span>
        </header>
        <div class="panel-body">
        <div class="adv-table">
        <table  class="display table table-bordered table-striped" id="dynamic-table">
        <thead>
        <tr>
            <th>ID</th>
            <th>NAME</th>
            <th>age</th>
            <th class="hidden-phone">email</th>
            <th class="hidden-phone">dept_id</th>
            <th>功能</th>
        </tr>
        </thead>
        <tbody>

        <tr th:each="user:${page.records}"  class="gradeX">
            <td th:text="${user.id}">Trident</td>
            <td th:text="${user.name}">Internet
                Explorer 4.0</td>
            <td th:text="${user.age}">Win 95+</td>
            <td  th:text="${user.email}" class="center hidden-phone">4</td>
            <td th:text="${user.deptId}" class="center hidden-phone">X</td>
            <td >
                <a class="btn btn-primary">编辑</a>
                <a class="btn btn-danger">删除</a>
            </td>
        </tr>

        </tbody>

        <tfoot>

        </tfoot>
        </table>
            <div class="col-md-6">
                当前第[[${page.getCurrent()}]]页，总共[[${page.getPages()}]]页，共[[${page.getTotal()}]]条记录
            </div>
            <div class="col-md-6">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li>
                            <a th:href="@{/dynamicTable(pn='1')}" href="#" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>

                        <li th:class="${pages==page.getCurrent()}?'active':''" th:each="pages:${pagenum}"><a th:text="${pages}" th:href="@{/dynamicTable(pn=${pages})}" href="#">1</a></li>

                        <li>
                            <a th:href="@{/dynamicTable(pn=${page.getPages()})}" href="#" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>

        </div>
        </div>
        </section>
        </div>
        </div>

        </div>
        <!--body wrapper end-->

        <!--footer section start-->
        <footer>
            2014 &copy; AdminEx by ThemeBucket
        </footer>
        <!--footer section end-->


    </div>
    <!-- main content end-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<div th:replace="table/common:: #commenscript" >

<!--dynamic table-->
<script type="text/javascript" language="javascript" src="js/advanced-datatable/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="js/data-tables/DT_bootstrap.js"></script>
<!--dynamic table initialization -->
<script src="js/dynamic_table_init.js"></script>

<!--common scripts for all pages-->
<script src="js/scripts.js"></script>

</body>
</html>
